#pragma warning disable 0618
using System;
using System.Collections.Generic;
using Table.DataModel;
namespace Table.Dao
{
    public class TableGuideStepExtraDao:DaoBase<TableGuideStepExtra>
    {
        public override string GetFileName()
        {
            return "TableGuideStepExtra.csv";
        }
        public override void BuildIndex()
        {
            if (cacheList != null)
            {
                cachePrimaryInt = new Dictionary<int, TableGuideStepExtra>(cacheList.Count);
            }
            base.BuildIndex();
        }
        public override void AddPrimaryIndex(TableGuideStepExtra model)
        {
            #if UNITY_EDITOR
            if(cachePrimaryInt.ContainsKey(model.tag)) UnityEngine.Debug.LogError("数据表id重复:TableGuideStepExtra->id: " + model.tag);
            #endif
            cachePrimaryInt[model.tag] = model;
        }
        protected override TableGuideStepExtra ParseRowData(string[] rowData)
        {
            TableGuideStepExtra data = new TableGuideStepExtra();
            if (!string.IsNullOrEmpty(rowData[0]))
            {
                data.tag = int.Parse(rowData[0]);
            }
            if (!string.IsNullOrEmpty(rowData[1]))
            {
                data.envPrefabId = rowData[1];
            }
            if (!string.IsNullOrEmpty(rowData[2]))
            {
                data.type = rowData[2];
            }
            if (!string.IsNullOrEmpty(rowData[3]))
            {
                data.maskType = int.Parse(rowData[3]);
            }
            if (!string.IsNullOrEmpty(rowData[4]))
            {
                data.isAlpha0 = int.Parse(rowData[4]);
            }
            if (!string.IsNullOrEmpty(rowData[5]))
            {
                data.isRaycast = int.Parse(rowData[5]);
            }
            if (!string.IsNullOrEmpty(rowData[6]))
            {
                data.param = rowData[6];
            }
            if (!string.IsNullOrEmpty(rowData[7]))
            {
                data.dialogType = int.Parse(rowData[7]);
            }
            if (!string.IsNullOrEmpty(rowData[8]))
            {
                data.dialogPosX = double.Parse(rowData[8]);
            }
            if (!string.IsNullOrEmpty(rowData[9]))
            {
                data.dialogPosY = double.Parse(rowData[9]);
            }
            if (!string.IsNullOrEmpty(rowData[10]))
            {
                data.dialogWidth = double.Parse(rowData[10]);
            }
            if (!string.IsNullOrEmpty(rowData[11]))
            {
                data.dialogHeight = double.Parse(rowData[11]);
            }
            if (!string.IsNullOrEmpty(rowData[12]))
            {
                data.textModuleId = rowData[12];
            }
            if (!string.IsNullOrEmpty(rowData[13]))
            {
                data.frameType = int.Parse(rowData[13]);
            }
            if (!string.IsNullOrEmpty(rowData[14]))
            {
                data.skipSide = int.Parse(rowData[14]);
            }
            return data;
        }
    }
}
